package org.example.ai_chat.util;


/**
 * 自定义状态码
 */
public enum ResultCodeEnum {

    // 普通状态
    SUCCESS(200, "成功"),
    FAIL(20001, "失败"),
    PARAM_ERROR(20002, "参数不正确"),
    SERVICE_ERROR(20003, "服务异常"),
    DATA_ERROR(20004, "数据异常"),
    ILLEGAL_REQUEST(20005, "非法请求"),
    REPEAT_SUBMIT(20006, "重复提交"),
    FAIL_REQUEST(20007, "请求失败"),
    FAIL_CHANGE(20008, "修改失败"),
    QUERY_FAIL(20009, "您查询的数据不存在"),

    ADMIN_ACCOUNT_EXIST_ERROR(30001, "账号已存在"),
    ADMIN_CAPTCHA_CODE_ERROR(30002, "验证码错误"),
    ADMIN_CAPTCHA_CODE_EXPIRED(30003, "验证码已过期"),
    ADMIN_CAPTCHA_CODE_NOT_FOUND(30004, "未输入验证码"),

    ADMIN_LOGIN_AUTH(30005, "未登录"),
    ADMIN_ACCOUNT_NOT_EXIST_ERROR(30006, "账号不存在"),
    ADMIN_ACCOUNT_ERROR(30007, "用户名或密码错误"),
    ADMIN_ACCOUNT_DISABLED_ERROR(30008, "该用户已被禁用"),
    ADMIN_ACCESS_FORBIDDEN(30009, "无访问权限"),

    SESSION_ALREADY_EXISTS(40007, "会话已存在");


    private Integer code;
    private String msg;

    ResultCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public Integer getCode() {
        return code;
    }
}
